﻿@model IEnumerable<BeanOverflow.Models.QuestionAndResponsesModel>

@{
    ViewBag.Title = "SearchIndex";
}

<h2>SearchIndex</h2>

<p>
      @using (Html.BeginForm()){   
         <p> Title: @Html.TextBox("SearchString") <br />  
         <input type="submit" value="Filter" /></p>
        }

</p>
<table>
    <tr>
        <th>
            Votes
        </th>
         <th>
            Answers
        </th>
        <th>
            Title
        </th>
        <th>
            Asked
        </th>
        <th>
            Edited
        </th>
        <th>
            Created by
        </th>
       
       
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Question.Votes)
        </td>
        <td>
          @Html.DisplayFor(modelItem => item.Responses.ToList().Count)
        </td>
        <td>
           @Html.ActionLink(item.Question.Title, "../QuestionAndResponsesModel/Details", new { id = item.Question.ID })
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Question.CreatedDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Question.LastModifiedDate)
        </td>
        <td>
             @Html.ActionLink(item.Question.UserName, "Details/" + item.Question.UserName, "MemberProfile")
        </td>
       
        
    </tr>
}

</table>
